package com.hnmqet.demo01.plus;

import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import net.sf.jsqlparser.statement.replace.Replace;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * Created by TD on 2020/7/27
 * 自定义SQL注入器
 */
public class MySqlInjector extends DefaultSqlInjector {

    @Override
    public List<AbstractMethod> getMethodList(Class<?> mapperClass) {
        List<AbstractMethod> methodList = new ArrayList<>();
        // 添加自定义的注入器
        methodList.add(new FindOne());

        // 添加原有的注入器
        methodList.addAll(super.getMethodList(mapperClass));
        return Collections.unmodifiableList(methodList);
    }
}
